﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<script>
    $(function () {
        initControl();
        gridList();
    });
    function initControl() {
        var myLayout = $('#layout').layout({ resizeable: false });
        $('select').bindSelect();
        $('#showTable input[type="text"]').attr("readonly", "readonly"); 
    }


    function gridList() {
        var $gridList1 = $("#gridList1");
        $gridList1.dataGrid({
            url: "/BOM/Product/GetJqxlListJson",
            height: $(window).height() - 160,
            colModel: [
                { label: '下料卡号', name: 'MatNO', width: 130, align: 'left', sortable: false, frozen: true },
                { label: '毛坯符号', name: 'Sign_MP', width: 60, align: 'center', sortable: false },
                { label: '材料牌号', name: 'MaterialCodeAll', width: 80, align: 'left', sortable: false },
                { label: '材料规格(mm)', name: 'MaterialSizesAll', width: 100, align: 'left', sortable: false },
                { label: '开卷尺寸(mm)', name: 'MaterialSizesLast', width: 100, align: 'left', sortable: false },
                { label: '剪切规格(mm)', name: 'MaterialSizes_J', width: 100, align: 'left', sortable: false },
                { label: '投料重量(Kg)', name: 'FQuantity_GBZL', width: 100, align: 'right', sortable: false },
                { label: '一张几块', name: 'FYZJK', width: 60, align: 'right', sortable: false },
                { label: '一块几件', name: 'FYKJJ', width: 60, align: 'right', sortable: false },
                { label: '一张几件', name: 'FYZJK_FYKJJ', width: 60, align: 'right', sortable: false },
                { label: '零件净重(Kg)', name: 'PartsNetWeight', width: 80, align: 'right', sortable: false },
                { label: '材料定额(Kg)', name: 'MaterialQuotaAll', width: 80, align: 'right', sortable: false },
                { label: '利用率(%)', name: 'LYL_All', width: 80, align: 'right', sortable: false },
                { label: '毛坯尺寸(mm)', name: 'RoughsSize', width: 100, align: 'left', sortable: false },
                { label: '宽度公差(mm)', name: 'KGC', width: 120, align: 'left', sortable: false },
                { label: '长度公差(mm)', name: 'CGC', width: 120, align: 'left', sortable: false },
                { label: '标准编号', name: 'StandardNumberAll', width: 80, align: 'left', sortable: false },
                { label: '特殊要求', name: 'MaterialDemandAll', width: 80, align: 'left', sortable: false },
                { label: '一级废料规格', name: 'FLGG1', width: 80, align: 'center', sortable: false },
                { label: '一级废料重量', name: 'FLZL1', width: 80, align: 'right', sortable: false },
                { label: '二级废料规格', name: 'FLGG2', width: 80, align: 'center', sortable: false },
                { label: '二级废料重量', name: 'FLZL2', width: 80, align: 'right', sortable: false },
                { label: '三级废料规格', name: 'FLGG3', width: 80, align: 'center', sortable: false },
                { label: '三级废料重量', name: 'FLZL3', width: 80, align: 'right', sortable: false },
                { label: '余料规格1(mm)', name: 'YLGG1', width: 80, align: 'center', sortable: false },
                { label: '余料数量1', name: 'YLSL1', width: 80, align: 'center', sortable: false },
                { label: '余料规格2(mm)', name: 'YLGG2', width: 80, align: 'center', sortable: false },
                { label: '余料数量2', name: 'YLSL2', width: 80, align: 'center', sortable: false },
                { label: '余料规格3(mm)', name: 'YLGG3', width: 80, align: 'center', sortable: false },
                { label: '余料数量3', name: 'YLSL3', width: 80, align: 'center', sortable: false },
                { label: '输入人员', name: 'InputUser', width: 80, align: 'center', sortable: false },
                { label: '输入日期', name: 'InputDate', width: 80, align: 'center', sortable: false },
                { label: '输入时间', name: 'InputTime', width: 80, align: 'center', sortable: false },
                { label: '审核人员', name: 'FAuditingBy', width: 80, align: 'center', sortable: false },
                { label: '审核日期', name: 'FAuditingDate', width: 80, align: 'center', sortable: false },
                { label: '审核时间', name: 'FAuditingTime', width: 80, align: 'center', sortable: false }
            ],
            sortname: 'MatNO asc',
            viewrecords: true,
            rownumWidth: 40,
            onSelectRow: function (rowid) {
            }
        });
        $gridList1.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');
        //$gridList1.jqGrid('setFrozenColumns');

        var $gridList2 = $("#gridList2");
        $gridList2.dataGrid({
            url: "/BOM/Product/GetJqgxListJson",
            height: $(window).height() - 300,
            colModel: [
                { label: '工序号', name: 'ProcessNO', width: 110, align: 'left', sortable: false, frozen: true },
                { label: '工序名称', name: 'ProcessName', width: 150, align: 'left', sortable: false, frozen: true },
                { label: '主生产线', name: 'ZLineNO', width: 80, align: 'left', sortable: false },
                { label: '主线设备型号', name: 'EquipNO', width: 80, align: 'left', sortable: false },
                { label: '设备编号', name: 'EquipSBNO', width: 80, align: 'left', sortable: false },
                { label: '单件生产工时', name: 'Manhour', width: 80, align: 'center', sortable: false },
                { label: '单件工艺工时', name: 'Technologyhour', width: 80, align: 'center', sortable: false },
                { label: '批次准结工时', name: 'Moduelhour', width: 80, align: 'center', sortable: false },
                { label: '批次工艺准结工时', name: 'PModuelhour', width: 80, align: 'center', sortable: false },
                { label: '工艺定员', name: 'PerNum', width: 80, align: 'right', sortable: false },
                { label: '副生产线1', name: 'FLineNO1', width: 80, align: 'center', sortable: false },
                { label: '副线1设备型号', name: 'EquipNO1', width: 80, align: 'center', sortable: false },
                { label: '副线1设备编号', name: 'EquipSBNO1', width: 80, align: 'center', sortable: false },
                { label: '单线生产工时', name: 'Manhour1', width: 80, align: 'center', sortable: false },
                { label: '单件工艺工时', name: 'Technologyhour1', width: 80, align: 'center', sortable: false },
                { label: '批次准结工时', name: 'Moduelhour1', width: 80, align: 'center', sortable: false },
                { label: '批次工艺准结工时', name: 'PModuelhour1', width: 80, align: 'center', sortable: false },
            ],
            sortname: 'ProcessNO asc',
            viewrecords: true,
            rownumWidth: 40,
            onSelectRow: function (rowid) {
                var rowDatas = $gridList2.jqGrid('getRowData', rowid);
                //alert(JSON.stringify(rowDatas));
                for (var p in rowDatas) {
                    $("#txtR4" + p).val(rowDatas[p]);
                }
            }
        });
        $gridList2.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');
        //$gridList2.jqGrid('setFrozenColumns');

        var $gridList3 = $("#gridList3");
        $gridList3.dataGrid({
            url: "/BOM/Product/GetCygxListJson",
            height: $(window).height() - 300,
            colModel: [
                { label: '工序号', name: 'ProcessNO', width: 110, align: 'left', sortable: false, frozen: true },
                { label: '工序名称', name: 'ProcessName', width: 150, align: 'left', sortable: false, frozen: true },
                { label: '模具编号', name: 'MoldNO', width: 80, align: 'left', sortable: false },
                { label: '模具名称', name: 'MoldName', width: 80, align: 'left', sortable: false },
                { label: '主生产线', name: 'ZLineNO', width: 80, align: 'left', sortable: false },
                { label: '主线设备型号', name: 'EquipNO', width: 80, align: 'left', sortable: false },
                { label: '设备编号', name: 'EquipSBNO', width: 80, align: 'left', sortable: false },
                { label: '单件生产工时', name: 'Manhour', width: 80, align: 'center', sortable: false },
                { label: '单件工艺工时', name: 'Technologyhour', width: 80, align: 'center', sortable: false },
                { label: '批次准结工时', name: 'Moduelhour', width: 80, align: 'center', sortable: false },
                { label: '批次工艺准结工时', name: 'PModuelhour', width: 80, align: 'center', sortable: false },
                { label: '工艺定员', name: 'PerNum', width: 80, align: 'right', sortable: false },
                { label: '副生产线1', name: 'FLineNO1', width: 80, align: 'center', sortable: false },
                { label: '副线1设备型号', name: 'EquipNO1', width: 80, align: 'center', sortable: false },
                { label: '副线1设备编号', name: 'EquipSBNO1', width: 80, align: 'center', sortable: false },
                { label: '单线生产工时', name: 'Manhour1', width: 80, align: 'center', sortable: false },
                { label: '单件工艺工时', name: 'Technologyhour1', width: 80, align: 'center', sortable: false },
                { label: '批次准结工时', name: 'Moduelhour1', width: 80, align: 'center', sortable: false },
                { label: '批次工艺准结工时', name: 'PModuelhour1', width: 80, align: 'center', sortable: false },
            ],
            sortname: 'ProcessNO asc',
            viewrecords: true,
            rownumWidth: 40,
            onSelectRow: function (rowid) {
                var rowDatas = $gridList3.jqGrid('getRowData', rowid);
                //alert(JSON.stringify(rowDatas));
                for (var p in rowDatas) {
                    $("#txtR5" + p).val(rowDatas[p]);
                }
                $.getJSON('/BOM/Product/GetModlItemJson', { id: rowDatas.MoldNO }, function (data) {
                    for (var p in data) {
                        $("#txtR5" + p).val(data[p]);
                    }
                    if (data.IsDisable == '0') {
                        $('#zaiyong').prop('checked', true);
                        $('#tingyong').prop('checked', false);
                    } else {
                        $('#zaiyong').prop('checked', false);
                        $('#tingyong').prop('checked', true);
                    }
                })
            }
        });
        $gridList3.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');
        //$gridList3.jqGrid('setFrozenColumns');
    }

 
</script>
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <div id="showTable" class="ui-layout-center">
        <div style="padding:10px 15px;">
            <ul id="myTab" class="nav nav-tabs" style="">
                <li class="active"><a href="#info1" data-toggle="tab">产品信息</a></li>
                <li><a href="#info2" data-toggle="tab">产品信息2</a></li>
                <li><a href="#info3" data-toggle="tab">产品信息3</a></li>
                <li><a href="#info4" data-toggle="tab">产品信息4</a></li>
                <li><a href="#info5" data-toggle="tab">产品信息5</a></li>
            </ul>
            <div id="myTabContent" class="tab-content" style="padding-top:10px;">
                <div class="tab-pane fade in active" id="info1">
                    <div style="padding-top: 5px;margin-right:10px;">
                        <div style="padding-bottom: 5px; border-bottom: 1px solid #ccc;">
                            <table class="form" >
                                <tr>
                                    <th class="formTitle" style="width:100px;">零件编号</th>
                                    <td class="formValue" style="width:130px;">
                                        <input id="txtR4FProductionNO" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:110px;">单位</th>
                                    <td class="formValue" style="width:130px;">
                                        <input id="txtR4FProCompanyAll" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:120px;">剪切生产工时</th>
                                    <td class="formValue" style="width:80px;">
                                        <input id="txtR4Manhour_JQ" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:100px;">&nbsp;</th>
                                    <td class="formValue" style="width:80px;">
                                        &nbsp;
                                    </td>
                                </tr>  
                            </table>
                        </div>
                    </div>
                    <table id="gridList3"></table>
                </div>
                <div class="tab-pane fade" id="info2">
                    <div style="padding-top: 5px;margin-right:10px;">
                        <table class="form" style="width:900px;">
                            <tr>
                                <th class="formTitle" style="width:100px;">零件编号</th>
                                <td class="formValue input-width-210" style="width:240px;">
                                    <input id="txtR2FProductionNO" type="text" class="form-control" value="" />
                                </td>
                                <th class="formTitle" style="width:100px;">利废零件</th>
                                <td class="formValue input-width-210">
                                    <input id="txtR2WasteFProductionNO" type="text" class="form-control" value="" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="tab-pane fade" id="info3" style="width:900px;">
                  
                    <div style="padding-top: 15px; margin-right: 10px;">
                    </div>
                </div>
                <div class="tab-pane fade" id="info4">
                    <div style="padding-top: 5px;margin-right:10px;">
                        <div style="padding-left:10px;">
                            <table class="form">
                                <tr>
                                    <th class="formTitle" style="width:100px;">零件编号</th>
                                    <td class="formValue" style="width:130px;">
                                        <input id="txtR4FProductionNO" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:110px;">单位</th>
                                    <td class="formValue" style="width:130px;">
                                        <input id="txtR4FProCompanyAll" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:120px;">剪切生产工时</th>
                                    <td class="formValue" style="width:80px;">
                                        <input id="txtR4Manhour_JQ" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:100px;">&nbsp;</th>
                                    <td class="formValue" style="width:80px;">
                                        &nbsp;
                                    </td>
                                </tr>                             
                            </table>
                        </div>
                        <table id="gridList2"></table>
                    </div>
                </div>
                <div class="tab-pane fade" id="info5">
                    <div style="padding-top: 5px;margin-right:10px;">
                        <div style="padding-left:10px;">
                            <table class="form">
                                <tr>
                                    <th class="formTitle" style="width:100px;">零件编号</th>
                                    <td class="formValue" style="width:130px;">
                                        <input id="txtR5FProductionNO" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:110px;">单位</th>
                                    <td class="formValue" style="width:130px;">
                                        <input id="txtR5FProCompanyAll" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:120px;">剪切生产工时</th>
                                    <td class="formValue" style="width:80px;">
                                        <input id="txtR5Manhour_JQ" type="text" class="form-control" value="" />
                                    </td>
                                    <th class="formTitle" style="width:100px;">&nbsp;</th>
                                    <td class="formValue" style="width:80px;">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <table id="gridList3"></table>
                       </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
 







